package com.ckf.es.controller;

import com.ckf.es.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author: serene
 * @date: 2020/10/29 9:22
 */
@RestController
@RequestMapping("emp")
public class EmpController {

    @Autowired
    private EmpService empService;

    /**
     * 将数据库中的数据全部导入到ES
     *
     * @return
     * @throws IOException
     */
    @RequestMapping("importAll")
    public String importAll() throws IOException {
        empService.importAll();
        return "success";
    }


}
